// 下划线变驼峰
const humps = require('humps');
/**
 * @param {any | undefined} [data]
 */
function successMsg(data) {
    return {
        code: 0,
        data: humps.camelizeKeys(data),
        msg: '成功'
    }
}

/**
 * @param {any | undefined} [data]
 */
function errorMsg(data) {
    return {
        code: -1,
        data: humps.camelizeKeys(data),
        msg: '失败'
    }
}
function page({data,total,pageIndex}){
    return {
        records:data,
        total,
        pageIndex
    }
}
// 秘钥
const security_key='zkw_mysql'
// 房间状态
const roomState={
    empty:1,// 空闲
    busy:2 // 入住
}
module.exports = {
    successMsg,
    errorMsg,
    page,
    security_key,
    roomState
}